package com.benyi.byiee.config;

import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.benyi.byiee.filter.MyFilter;

//@Configuration
public class FilterConfig {

	@Bean
	public FilterRegistrationBean<MyFilter> customFilterRegistration() {
		FilterRegistrationBean<MyFilter> registrationBean = new FilterRegistrationBean<>();
		registrationBean.setFilter(new MyFilter());
		registrationBean.addUrlPatterns("/*"); // 过滤所有请求
		registrationBean.setOrder(1); // 设置过滤器顺序
		return registrationBean;
	}
}
